package com.MovieManageSystem.mapper;

import com.MovieManageSystem.domain.Feedback;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface FeedbackMapper {

    @Insert("INSERT INTO feedback (content) VALUES (#{content})")
    @Options(useGeneratedKeys = true, keyProperty = "fid")
    void insertFeedback(Feedback feedback);

    @Select("SELECT * FROM feedback WHERE fid = #{fid}")
    Feedback findFeedbackById(Integer fid);

    @Select("SELECT * FROM feedback")
    List<Feedback> findAllFeedbacks();

    @Delete("DELETE FROM feedback WHERE fid = #{fid}")
    void deleteFeedbackByFid(Integer fid);
}
